<template>
  <el-table
    :data="tableData"
    header-align="center"
    class="customer-table"
    height="table"
    empty-text="暂无数据"
  >
    <el-table-column prop="name" label="姓名" align="center"> </el-table-column>
    <el-table-column align="center" label="性别">
      <template slot-scope="scope">
        <div>
          {{ scope.row.sex == 0 ? "男" : "女" }}
        </div>
      </template>
    </el-table-column>
    <el-table-column prop="phone" label="联系方式" align="center"> </el-table-column>
    <el-table-column prop="address" label="地址" align="center"> </el-table-column>
  </el-table>
</template>

<script>
export default {
  props: ["biaogeqingqiucanshu", "fenyexinxi"],
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    gengxin() {
      //更新表格
      this.huoqushuju();
    },
    chakanzhaopian(row) {
    },
    huoqushuju() {
      let params = new URLSearchParams();
      params.append("page", this.fenyexinxi.currentPage);
      params.append("size", this.fenyexinxi.pagesize);
      params.append("villageId", this.biaogeqingqiucanshu.selectcun);
      params.append("townId", this.biaogeqingqiucanshu.selectzhen);
      this.$axios
        .post("/leader/village/queryvillager", params)
        .then((response) => {
          this.tableData = response.data.data.data.records;
          // 设置数据total
          this.$emit("setfenyetotal", response.data.data.data.total);
        })
        .catch((err) => {
          console.log(err);
        });
    },
  },
};
</script>

<style lang="less" scoped>
.el-table {
  height: 100%;
}
</style>